package com.itheima.service;

import com.itheima.pojo.PageBean;
import com.itheima.pojo.User;
import jakarta.mail.MessagingException;

import java.util.List;

public interface UserService {
    //查找用户
    public User findByUsername(String username);

    //注册
    public void register(String username,String password,String email,String code);

    //更新用户数据
    public void update(User user);

    //更新用户头像
    public void updateAvatar(String avatarUrl);

    //更新用户密码
    public void updatePwd(String newPwd);

    List<User> getAllUserInfo();

    PageBean<User> userManage(Integer pageNum, Integer pageSize, String username, String nickname, String email);

    void deleteUser(Integer id);

    void addUser(User user);

    User findByUsernameOrEmail(String username, String email);

    User findByEmail(String email);

    User loginEmail(String email, String code);

    void sendEmailCode(String email,Integer type) throws MessagingException;

    User verifyByEmail(String email, String code);

    void resetPwd(String newPassword,Integer id);
}
